﻿<views:UserControlBase x:Class="GoG.Client.Views.NavigationUserControl"
                       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                       xmlns:controls="using:GoG.Client.Controls"
                       xmlns:converters="using:GoG.Client.Converters"
                       xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                       xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                       xmlns:viewModels="using:GoG.Client.ViewModels"
                       xmlns:views="using:GoG.Client.Views"
                       Width="130"
                       d:DataContext="{d:DesignInstance viewModels:PageViewModelBase,
                                                        d:IsDesignTimeCreatable=False}"
                       d:DesignHeight="600"
                       mc:Ignorable="d">

    <UserControl.Resources>
        <Style x:Key="LineSeparatorStyle"
               TargetType="Line">
            <Setter Property="X1" Value="5" />
            <Setter Property="X2" Value="35" />
            <Setter Property="Y1" Value="1" />
            <Setter Property="Y2" Value="1" />
            <Setter Property="Stroke" Value="#474747" />
            <Setter Property="Margin" Value="0,10" />
        </Style>

        <converters:EnumMatchToBoolConverter x:Key="EnumMatchToBoolConverter2" />
    </UserControl.Resources>
    <Border>
        <Grid x:Name="RootGrid">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <StackPanel Grid.Row="0"
                        Grid.RowSpan="2">

                <controls:NavigationButton Command="{Binding MyGamesCommand}"
                                           Icon="&#xF015;"
                                           IsSelected="{Binding CurrentPageArea,
                                                                Converter={StaticResource EnumMatchToBoolConverter2},
                                                                ConverterParameter=MyGames}"
                                           Text="My Games" />


                <Line Style="{StaticResource LineSeparatorStyle}" />

                <controls:NavigationButton x:Uid="LogoutBtn"
                                           Command="{Binding LogoutCommand}"
                                           Icon="&#xF08b;"
                                           Text="Log Out" />
            </StackPanel>

            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="SizeGroup">
                    <VisualState x:Name="Expanded">
                        <Storyboard>
                            <DoubleAnimation From="0"
                                             Storyboard.TargetName="RootGrid"
                                             Storyboard.TargetProperty="Width"
                                             To="100">
                                <DoubleAnimation.EasingFunction>
                                    <QuadraticEase />
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Collapsed" />
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
        </Grid>
    </Border>

</views:UserControlBase>
